//
//  Cell01.m
//  LastTemp
//
//  Created by dllo on 15/4/24.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Cell01.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation Cell01
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.detailView = [[UIView alloc] init];
//        self.detailView.backgroundColor = [UIColor colorWithRed:185 / 255.0 green:221 / 255.0 blue:244 / 255.0 alpha:1];
        self.detailView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"9"]];
        self.detailView.layer.cornerRadius = 10;
        [self.contentView addSubview:self.detailView];
        [_detailView release];
        
        self.detailImageView = [[UIImageView alloc] init];
        [self.detailView addSubview:self.detailImageView];
        [_detailImageView release];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.detailView addSubview:self.nameLabel];
        [_nameLabel release];
        
        self.singerNameLabel = [[UILabel alloc] init];
        self.singerNameLabel.font = [UIFont systemFontOfSize:14];
        [self.detailView addSubview:self.singerNameLabel];
        [_singerNameLabel release];
    }
    return self;
}
- (void)dealloc
{
    [_singerNameLabel release];
    [_nameLabel release];
    [_detailImageView release];
    [_detailView release];
    [super dealloc];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    // 设置尺寸
    self.detailView.frame = CGRectMake(10, 5, WIDTH - 20, HEIGHT - 10);
    self.nameLabel.frame = CGRectMake(50, 15, self.detailView.frame.size.width - 50, 30);
    self.singerNameLabel.frame = CGRectMake(50, 55, self.detailView.frame.size.width - 50, 30);
    self.detailImageView.frame = CGRectMake(20, 30, 20, 20);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
